Repository navigation
FOUR-34496 Skeleton improvement and coding agent setup - #9192
Conversation
PR SummaryLow Risk Overview
Reviewed by Cursor Bugbot for commit 964170c. Bugbot is set up for automated code reviews on this repo. Configure here. |
| * Same two passes as PluginManager::redactHttpUserInfoFromString() in core: a pasted clone URL | ||
| * with credentials must never reach the prompt, the clipboard or the agent transcript. | ||
| */ | ||
| export function stripUrlUserInfo(value) { |
There was a problem hiding this comment.
🔒 Agentic Security Review
Severity: MEDIUM
Description: stripUrlUserInfo() does not remove HTTP userinfo when the pasted clone URL has an unencoded @ in the username. The first replace requires user:password with no @ in either part, and the second replace deletes only through the first @ and does not run again. https://user@domain.com:ghp_secret@github.com/org/repo.git therefore becomes https://domain.com:[REDACTED]@github.com/org/repo.git. That residual is still a normal user:password URL (username domain.com, password ghp_secret, host github.com). buildMcpSetupPrompt() writes it to PLUGIN_REPO, and Copy prompt / View prompt publish that string.
Impact: A manage-plugins admin who pastes an email-style clone URL (a form the Repository URL field accepts) and then copies the setup prompt still puts a live git password or PAT on the clipboard and into Claude, Cursor, or another agent. The prompt is built to be pasted there, and its own rules say a git token must not enter that chat. The separate Token field is excluded; this path leaks the credential embedded in plugin.url. Git and the WHATWG URL parser both treat the leftover URL as authenticated userinfo, so the agent can reuse it.
Remediation: Parse the repository URL with the URL constructor and rebuild it with username and password cleared, repeating until both are empty. If parsing fails or the serialized URL still contains userinfo, omit PLUGIN_REPO from the prompt instead of embedding it. Do not treat the two-pass userinfo regular expression as the redaction gate.
|





Issue & Reproduction Steps
The Copy prompt panel of the Create Plugin dialog (FOUR-34495, #9189) was static: it ignored the form, never mentioned
package-skeleton, installed skills interactively and did not state the requirements. Installing a plugin from an empty repository also failed with a generic error.Solution
resources/js/admin/plugins/mcpSetupPrompt.js(new, pure functions): builds the prompt from the dialog values (instance URL, repository URL, plugin name derived likePluginManager::extractRepoName(), branch, Git username, profile) and lists the 4 MCP endpoints (/mcp/processes,/mcp/screens,/mcp/data-connectors,/mcp/flow-genies). It checks Git and Node (>= 22, 24 recommended) first, then installs thepm4-plugin-setupskill non-interactively and hands over to it. The Git token is never part of the prompt.Plugins.vue: profile selector (PM4 only / Migration), prompt wired to the form, hints on the Install button and the token field.PluginManager::validatePlugin(): when the cloned repository is empty (no commits), throws a clear message ("push the plugin skeleton first") instead of the generic one. Covered by a new test intests/Managers/PluginManagerTest.php.How to Test
docker exec --env-file compose/envs/app.env.testing pm4_core ./vendor/bin/phpunit --filter <test name> tests/Managers/PluginManagerTest.php(run one test per process: the whole file has pre-existing failures with thestorage/plugins/package-examplefixture).Related Tickets & Packages
FOUR-34496
ProcessMaker/package-skeleton#31
#9192
Code Review Checklist